package swttestingagent;

import abbot.swt.utilities.Displays;

import com.gerhardtinformatics.rcprobot.IRCPRobot;
import com.gerhardtinformatics.rcprobot.RCPRobot;

public class RobotRapper {
	

	private IRCPRobot rcpRobot;

	public RobotRapper(){
		rcpRobot = new RCPRobot();
	}
	
	

	public int enterSpecialKey(final String keyName) throws Throwable{
		rcpRobot.enterSpecialKey(keyName);
		return 0;
	}
	
	public int clickButton(String buttonText){
		rcpRobot.clickButton(buttonText);
		return 0;
	}



	public int assertActivePerspective(String name) {
		rcpRobot.assertActivePerspective(name); 
		return 0;
		
	}



	
	public int assertMenuItemChecked(String path) {
		rcpRobot.assertMenuItemChecked(path);
		return 0;
		
	}



	
	public int assertMenuItemDisabled(String path) {
		rcpRobot.assertMenuItemDisabled(path);
		return 0;
		
	}



	
	public int assertMenuItemEnabled(String path) {
		rcpRobot.assertMenuItemEnabled(path);
		return 0;
		
	}



	
	public int assertMenuItemExists(String path) {
		rcpRobot.assertMenuItemExists(path);
		return 0;
		
	}



	
	public int assertMenuItemNotChecked(String path) {
		rcpRobot.assertMenuItemNotChecked(path);
		return 0;
		
	}



	
	public int assertNodeExistsInView(String viewName, String treePath) {
		rcpRobot.assertNodeExistsInView(viewName, treePath);
		return 0;
		
	}



	
	public int assertNodeNotExistsInView(String viewName, String treePath) {
		rcpRobot.assertNodeNotExistsInView(viewName, treePath);
		return 0;
	}



	
	public int assertToolBarActionDisabled(String toolTipText) {
		rcpRobot.assertToolBarActionDisabled(toolTipText);
		return 0;
	}



	
	public int assertToolBarActionEnabled(String toolTipText) {
		rcpRobot.assertToolBarActionEnabled(toolTipText);
		return 0;
	}



	
	public int assertToolBarActionExists(String toolTipText) {
		rcpRobot.assertToolBarActionExists(toolTipText);
		return 0;
	}



	
	public int assertToolBarActionNotExists(String toolTipText) {
		rcpRobot.assertToolBarActionNotExists(toolTipText);
		return 0;
	}



	
	public int assertToolBarDropDownActionDisabled(String text) {
		rcpRobot.assertToolBarDropDownActionDisabled(text);
		return 0;
	}



	
	public int assertToolBarDropDownActionEnabled(String text) {
		rcpRobot.assertToolBarDropDownActionEnabled(text);
		return 0;
	}



	
	public int assertToolBarDropDownActionExists(String text) {
		rcpRobot.assertToolBarDropDownActionExists(text);
		return 0;
	}



	
	public int assertToolBarDropDownActionNotExists(String text) {
		rcpRobot.assertToolBarDropDownActionNotExists(text);
		return 0;
	}



	
	public int assertViewExists(String viewName) {
		rcpRobot.assertViewExists(viewName);
		return 0;		
	}



	
	public int assertViewNotExists(String viewName) {
		rcpRobot.assertViewNotExists(viewName);
		return 0;
	}



	
	public int assertWindowTitle(String title) {
		rcpRobot.assertWindowTitle(title);
		return 0;
	}



	
	public int clickButtonInEditor(String button, String path) {
		rcpRobot.clickButtonInEditor(button, path);
		return 0;
	}



	
	public int clickLabel(String labelText) {
		rcpRobot.clickLabel(labelText);
		return 0;
	}



	
	public int clickPopUpTree(String viewName, String treeItemPath,
			String menuPath) {
		rcpRobot.clickPopUpTree(viewName, treeItemPath, menuPath);
		return 0;
	}



	
	public int clickTab(String tabText) {
		rcpRobot.clickTab(tabText);
		return 0;
	}



	
	public int closeView(String viewName) {
		rcpRobot.closeView(viewName);
		return 0;	
	}



	
	public int closeWelcomeView() {
		rcpRobot.closeWelcomeView();
		return 0;
	}



	
	public int delay(int ms) {
		rcpRobot.delay(ms);
		return 0;
	}



	
	public int doubleClickTree(String viewName, String path) {
		rcpRobot.doubleClickTree(viewName, path);
		return 0;
	}



	
	public int enterCharacter(int c) {
		rcpRobot.enterCharacter((char)c);
		return 0;
	}



	
	public int enterCharacters(String string) {
		rcpRobot.enterCharacters(string);
		return 0;
	}



	
	public int enterKeyCombination(String accelerator) {
		rcpRobot.enterKeyCombination(accelerator);
		return 0;
	}



	
	public int enterSpecialKey(String accelerator, int times) {
		rcpRobot.enterSpecialKey(accelerator, times);
		return 0;
	}



	
	public int enterString(String string) {
		rcpRobot.enterString(string);
		return 0;
	}



	
	public int holdKey(String accelerator) {
		rcpRobot.holdKey(accelerator);
		return 0;
	}



	
	public int openPerspective(String name) {
		rcpRobot.openPerspective(name);
		return 0;
	}



	
	public int openView(String path) {
		rcpRobot.openView(path);
		return 0;
	}



	
	public int releaseKey(String accelerator) {
		rcpRobot.releaseKey(accelerator);
		return 0;
	}



	
	public int selectContextMenuInView(String viewName, String path) {
		rcpRobot.selectContextMenuInView(viewName, path);
		return 0;
	}



	
	public int selectMenuItem(final String path) {
//		Displays.syncExec(new Runnable(){
//
//			@Override
//			public void run() {
				try {
					rcpRobot.selectMenuItem(path);
				} catch (Throwable t){
					t.printStackTrace();
				}
//			}
//			
//		});
		return 0;
	}



	
	public int selectNodeContextMenuInView(String viewName, String treePath,
			String menuPath) {
		rcpRobot.selectNodeContextMenuInView(viewName, treePath, menuPath);
		return 0;
	}



	
	public int selectNodeInView(String viewName, String path) {
		rcpRobot.selectNodeInView(viewName, path);
		return 0;
	}



	
	public int selectPageInEditor(String path) {
		rcpRobot.selectPageInEditor(path);
		return 0;
	}



	
	public int selectToolBarAction(String toolTipText) {
		rcpRobot.selectToolBarAction(toolTipText);
		return 0;
	}



	
	public int selectToolBarDropDownAction(String text) {
		rcpRobot.selectToolBarDropDownAction(text);
		return 0;
	}



	
	public int setFocusOnEditor(String editorName) {
		rcpRobot.setFocusOnEditor(editorName);
		return 0;
	}



	
	public int setFocusOnView(String viewName) {
		rcpRobot.setFocusOnView(viewName);
		return 0;
	}



	
	public int waitForShellShowing(String title) {
		rcpRobot.waitForShellShowing(title);
		return 0;
	}



	
	public int waitForShellShowing(String title, int timeout) {
		rcpRobot.waitForShellShowing(title, timeout);
		return 0;
	}

}
